package com.chance.cc.crawler.prod.command.trigger.domain.commerce.vip;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.commerce.vip.realtime.VipArticleCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.commerce.vip.realtime.VipArticleUrlCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.commerce.vip.realtime.VipCommentCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @ClassName vip
 * @Description TODO
 * @Author songding
 * @Date 2021/10/19 14:15
 * @Version 1.0
 **/
public class VipCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
        //唯品会评论
      // publishVipCommentScheduleTriggerInfo();
        //唯品会文章
      // publishVipArticleScheduleTriggerInfo();
        //唯品会文章每月采集一次全品链接
        publishVipArticleUrlScheduleTriggerInfo();
    }
    public static void publishVipCommentScheduleTriggerInfo(){
        CrawlerJob crawlerJob = VipCommentCrawlerScheduleJob.vipCrawlerJob();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                VipCommentCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                //CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "0 10 1 * * ?",
                //"",
                "唯品会评论每天凌晨1：10点采集一次");
    }

    public static void publishVipArticleScheduleTriggerInfo(){
        CrawlerJob crawlerJob = VipArticleCrawlerScheduleJob.vipCrawlerJob();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                VipCommentCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                //CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "0 10 17 * * ?",
                //"",
                "唯品会文章每天17：10点采集一次");
    }
    public static void publishVipArticleUrlScheduleTriggerInfo(){
        CrawlerJob crawlerJob = VipArticleUrlCrawlerScheduleJob.vipCrawlerJob();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                VipCommentCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                //CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "0 0 5 28 * ?",
                //"",
                "唯品会文章每月采集一次全品链接");
    }
}
